home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Synthesizer Source / Synthesizer Folder / SampleOscControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  4.0 KB  |  115 lines  |  [TEXT/KAHL]

  1. /* SampleOscControl.h */
  2.  
  3. #ifndef Included_SampleOscControl_h
  4. #define Included_SampleOscControl_h
  5.  
  6. /* SampleOscControl module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* FixedPoint */
  12. /* 64BitMath */
  13. /* FastFixedPoint */
  14. /* ModulationSpecifier */
  15. /* Multisampler */
  16. /* EnvelopeState */
  17. /* Envelope */
  18. /* LFOGenerator */
  19. /* LFOListSpecifier */
  20. /* SampleConsts */
  21. /* Memory */
  22. /* OscillatorSpecifier */
  23. /* FastModulation */
  24. /* ErrorDaemon */
  25.  
  26. #include "FixedPoint.h"
  27. #include "FastFixedPoint.h"
  28. #include "ModulationSpecifier.h"
  29.  
  30. struct SampleTemplateRec;
  31. typedef struct SampleTemplateRec SampleTemplateRec;
  32.  
  33. struct SampleStateRec;
  34. typedef struct SampleStateRec SampleStateRec;
  35.  
  36. /* forwards */
  37. struct OscillatorRec;
  38. struct ArrayRec;
  39. struct ErrorDaemonRec;
  40.  
  41. /* get rid of all cached memory for state or template records */
  42. void                                    FlushSampleOscControl(void);
  43.  
  44. /* perform one envelope update cycle */
  45. void                                    UpdateSampleEnvelopes(SampleStateRec* State);
  46.  
  47. /* dispose of the sample state record */
  48. void                                    DisposeSampleState(SampleStateRec* State);
  49.  
  50. /* dispose of the sample information template */
  51. void                                    DisposeSampleTemplate(SampleTemplateRec* Template);
  52.  
  53. /* create a new sample template */
  54. SampleTemplateRec*        NewSampleTemplate(struct OscillatorRec* Oscillator,
  55.                                                 float EnvelopeTicksPerSecond, long SamplingRate,
  56.                                                 MyBoolean Stereo, MyBoolean TimeInterp, MyBoolean WaveInterp,
  57.                                                 struct ErrorDaemonRec* ErrorDaemon);
  58.  
  59. /* create a new sample state object. */
  60. SampleStateRec*                NewSampleState(SampleTemplateRec* Template,
  61.                                                 float FreqForMultisampling, float Accent1, float Accent2,
  62.                                                 float Accent3, float Accent4, float Loudness, float HurryUp,
  63.                                                 long* PreOriginTimeOut, float StereoPosition,
  64.                                                 float InitialFrequency, float LoudnessLFOAmplitudeScaling,
  65.                                                 float LoudnessLFOFrequencyScaling, MyBoolean DoingModulation);
  66.  
  67. /* fix up pre-origin time for the sample state object */
  68. void                                    FixUpSampleStatePreOrigin(SampleStateRec* State,
  69.                                                 long ActualPreOrigin);
  70.  
  71. /* set a new frequency for a state object.  used for portamento */
  72. /* and modulation of frequency (vibrato) */
  73. void                                    SampleStateNewFrequency(SampleStateRec* State,
  74.                                                 float NewFrequencyHertz);
  75.  
  76. /* send a key-up signal to one of the oscillators */
  77. void                                    SampleKeyUpSustain1(SampleStateRec* State);
  78. void                                    SampleKeyUpSustain2(SampleStateRec* State);
  79. void                                    SampleKeyUpSustain3(SampleStateRec* State);
  80.  
  81. /* restart a sample oscillator.  this is used for tie continuations */
  82. void                                    RestartSampleState(SampleStateRec* State,
  83.                                                 float NewFreqMultisampling, float NewAccent1, float NewAccent2,
  84.                                                 float NewAccent3, float NewAccent4, float NewLoudness,
  85.                                                 float NewHurryUp, MyBoolean RetriggerEnvelopes,
  86.                                                 float NewStereoPosition, float NewInitialFrequency,
  87.                                                 float NewLoudnessLFOAmplitudeScaling,
  88.                                                 float NewLoudnessLFOFrequencyScaling);
  89.  
  90. /* generate a sequence of samples (called for each envelope clock) */
  91. void                                    SampleGenSamples(SampleStateRec* State,
  92.                                                 long SampleCount, largefixedsigned* RawBuffer);
  93.  
  94. /* find out if the sample oscillator has finished */
  95. MyBoolean                            SampleIsItFinished(SampleStateRec* State);
  96.  
  97. /* generate a single sample (called for modulation chains) */
  98. /* OutputPlace should have 1 entry for mono output or 2 entries for stereo output */
  99. float                                    SampleGenOneSample(SampleStateRec* State,
  100.                                                 ModulationTypes* PhaseGenModulateHow,
  101.                                                 float* PhaseGenModulationScaling,
  102.                                                 float* PhaseGenModulationOrigin,
  103.                                                 float* PhaseGenOldValues,
  104.                                                 long* PhaseGenIndirectionTable,
  105.                                                 long NumberOfPhaseGenModulators,
  106.                                                 ModulationTypes* OutputModulateHow,
  107.                                                 float* OutputModulationScaling,
  108.                                                 float* OutputModulationOrigin,
  109.                                                 float* OutputOldValues,
  110.                                                 long* OutputIndirectionTable,
  111.                                                 long NumberOfOutputModulators,
  112.                                                 largefixedsigned* OutputPlace);
  113.  
  114. #endif
  115.